package com.wms.service.impl;

import com.wms.dto.WareAndLocDTO;
import com.wms.mapper.WareAndLocMapper;
import com.wms.service.WareAndLocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
public class WareAndLocServiceImpl implements WareAndLocService {
    @Autowired
    WareAndLocMapper wareAndLocMapper;
    
    @Override
    public List<WareAndLocDTO> queryWareAndLocByStoreId(int storeId) {
        // 先查询所有仓库的ID
        List<Map> storeIds = wareAndLocMapper.queryAllStoreId();
        
        // 根据传入的storeId查询对应的仓库和库区信息
        List<WareAndLocDTO> result = wareAndLocMapper.queryWareAndLocByStoreId(storeId);
        
        return result;
    }
}
